﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for WorkflowUserControl
/// </summary>
public class WorkflowUserControl : BaseUserControl
{
    public EventHandler OnSave;
    public EventHandler OnSubmit;
    public EventHandler OnCancel;
    public EventHandler OnProcessed;

    public WorkflowUserControl()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public string Subject
    {
        set
        {
            ViewState["Subject"] = value;
        }
    }

    public string CategoryCode
    {
        set
        {
            ViewState["CategoryCode"] = value;
        }
    }

    public virtual void InitDate()
    {

    }

    public virtual void InitViewData(string instanceID, DataRow rowWorkflow, Boolean processVisibled)
    {
        
    }

    public virtual void InitEditData(string instanceID, DataRow rowWorkflow, Boolean processVisibled)
    {

    }

    protected virtual void On_Processed(object sender, EventArgs e)
    {
        if (OnProcessed != null)
        {
            OnProcessed(sender, e);
        }
    }

    protected virtual void On_Cancel(object sender, EventArgs e)
    {
        if (OnCancel != null)
        {
            OnCancel(sender, e);
        }
    }

    //protected virtual void On_ProcessedSelectRole(object sender, EventArgs e)
    //{
    //    if (OnProcessed != null)
    //    {
    //        OnProcessed(sender, e);
    //    }
    //}

    //protected virtual void On_CancelSelectRole(object sender, EventArgs e)
    //{
    //    if (OnCancel != null)
    //    {
    //        OnCancel(sender, e);
    //    }
    //}
    
}


//public class WorkflowState
//{
//    public static string Created = "Created";
//    public static string Running = "Running";
//    public static string Suspended = "Suspended";
//    public static string Terminated = "Terminated";
//    public static string Completed = "Completed";
//}